package com.example.mapper;

import com.example.pojo.bo.JobSeekerBO;
import com.example.pojo.dto.JobSeekerInformationDTO;
import com.example.pojo.entity.JobSeeker;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author 小岁
 * @version 2023/10/1 20:38
 */
public interface JobSeekerMapper {
    @Select("select * from job_seeker")
    List<JobSeeker> findAll();


    @Select("select * from job_seeker where js_account=#{value}")
    JobSeeker findByJsAccount(String js_account);

    @Select("select * from job_seeker where js_telephone=#{value}")
    JobSeeker findByJsTelephone(String jsTelephone);

//    @Insert("insert into job_seeker values(null,#{js_account},MD5(#{js_cipher}),22,now())")
//    @Insert("insert into job_seeker values(null,#{jsAccount},#{jsCipher},150542,aaaa,哈哈哈,0,now(),aaa,now(),黑龙江,0,1)")
//    int saves(JobSeeker jobSeeker);

    @Insert("insert into job_seeker(js_account,js_cipher,js_telephone,js_name,js_sex) values(#{jsAccount},#{jsCipher},12345678901,'高贤甫',1)")
    int save(@Param("jsAccount") String jsAccount, @Param("jsCipher") String jsCipher);

    @Insert("insert into job_seeker(js_account,js_cipher,js_telephone,js_name,js_sex) values(#{jsAccount},#{jsCipher},#{jsTelephone},'高贤甫',1)")
    int TblSave(@Param("jsAccount") String jsAccount, @Param("jsCipher") String jsCipher,@Param("jsTelephone") String jsTelephone);


    @Select("select id,js_name,js_sex,avatar,job_seek,age from job_seeker")
    List<JobSeekerBO> searchAll();
    @Select("select id,js_name,js_sex,avatar,job_seek,age from job_seeker where id=#{value}")
    JobSeekerBO searchByWord(Integer jsId);
    @Select("select id from job_seeker")
    List<Integer> searchAllId();
    List<Integer> searchByAge(@Param("startAge") Integer startAge,@Param("endAge") Integer endAge);

    @Select("select * from job_seeker where id=#{value}")
    JobSeeker findJSById(Integer id);
    int updateInformation(JobSeeker jobSeeker);

//    @Update("update job_seeker set js_name=#{},")

}
